<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
  
  <head>    
    <title>How to add/edit/delete Scenarios in SMG1</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link href="../../styles.css" rel="stylesheet">
    <link rel="icon" href="../../images/icon.png">
	</head>

	<body>

    <div id="top">
      <h1>How to add/edit/delete Scenarios in SMG1</h1> 
    </div>
			
    <div id="hot-links">
      <h2>Direct links</h2>
      <hr>
      <ol>
        <li><a href="../../index.html">Introduction</a></li>
        <li><a href="../tutorials.html">Tutorials</a></li>
        <li><a href="../resources.html">Resources</a></li>
      </ol>
    </div>
			
    <div id="main">

			<h2>Contents</h2>
			<hr>
      <ol>
        <li><a href="#tools">Required tools</a></li>
        <li><a href="#layer-zone-scenario">About Layers, Zones and Scenarios</a></li>
        <li><a href="#tutorials">Required tutorials</a></li>
        <li><a href="#steps">Steps</a></li>
      </ol>
      <br>

			<hr id="tools">
			<h2>Required tools</h2>
			<hr>
      <p>Go to <a href="../resources.html">Resources</a> for download links.</p>        
      <ul>
        <li>Whitehole Despag</li>
        <li>Whitehole for SMG1</li>
        <li>WiiExplorer</li>
        <li>Tomato</li>
      </ul>

			<hr id="layer-zone-scenario">
			<h2>About Layers, Zones and Scenarios</h2>
			<hr>

      <p> <b>Layers</b> serve as a way to group objects so they can only be shown on a <b>Zone</b> of a <b>Galaxy</b> in a certain <b>Scenario</b>. They can also be used to <b>categorize objects in a planet</b> so you can <b>edit objects separately</b> from other objects. They have a name that starts with <code>Layer</code> and ends with a <b>letter</b> (examples are <code>LayerA</code>, <code>LayerB</code>, <code>LayerC</code>, <b>etc.</b>).</p>
      
      <p><b>Zones</b> are a higher level of object grouping. They are <b>sections of a galaxy</b> and <b>can be placed anywhere inside of it</b>. They work for the purpose of <b>easing object placement around a Galaxy</b> using an offset respect to the Galaxy origin. They also work for optimization purposes (loading/unloading objects, at least that's what I believe).</p>
      
      <p>A <b>Scenario</b> is a combination of <b>Zones</b> and <b>Layers</b> with a <b>Star</b> that can be collected normally (end of the level) or when meeting a specific condition. It is basically <b>a level/mission on a Galaxy</b>. Their names are by default written in japanese but you can use latin characters to name them as well.</p>

      <br>
				
      <hr id="tutorials">
      <h2>Required tutorials</h2>
      <hr>
      <ul>
        <li><a href="basic/tb9.html">Edit text in SMG1</a></li>
      </ul>
      <br>  

			<hr id="steps">
			<h2>Steps</h2>
			<hr>

      <p>To add a <b>new Scenario</b> to a <b>Galaxy</b> you have to do <b>2 things</b>:</p>
      <p><b>1)</b> Add the pertinent <b>Scenario data</b> by using <b>Whitehole for SMG1</b>.</p>
      <p><b>2)</b> Add the <b>Scenario name</b> you are creating in the <code>Message.arc</code> <b>file</b> of the <b>language folder</b> you are using for your mod.</p>
      
      <br>
      <hr>
      <p><b>NOTE 1:</b> <b>2)</b> is done to avoid a <b>game crash</b> on a <b>text related function</b>.</p>
      <hr>
      <br>
      
      <p>First lets do <b>1)</b>. Open <b>Whitehole for SMG1</b> and open the <b>Scenario editor</b> for the <b>Galaxy</b> you want to add a <b>new Scenario</b>. In my case I will add a <b>new Scenario</b> to <b>FlipSwitch Galaxy</b> (<b>code name:</b> <code>FlipPanelExGalaxy</code>, <b>Fig. 1</b>)</p>
      
      <img style="width: 75%; margin-left: 12.5%;" src="../../images/lc3/fig1.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 1 - Scenario editor opened for FlipSwitch Galaxy)</p>
      <br>
      
      <p>Click on the <b>Scenario</b> <code>Add</code> <b>button</b> and set the following fields with needed logic (<b>Figs. 2 and 3</b>):</p>
      
      <p><b>- Scenario index: </b> Star number. Be sure that it is different to the other scenario's IDs.</p>
      <p><b>- Scenario name:</b> Name of the scenario :P. You can write stuff in English on it.</p>
      <p><b>- Power Star Spawner:</b> Condition used to make the star appear. <code>None</code> is to make the star available right away.</p>
      <p><b>- Comet type:</b> Prankster Comet to use (Purple coins, Speedy, etc.).</p>
      <p></p>
      <p><b>- Is hidden star?:</b> Star can be collected from another scenario. Check the star in that other scenario.</p>
      <p></p>
      
      <img style="width: 75%; margin-left: 12.5%;" src="../../images/lc3/fig2.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 2)</p>
      <br>
      <img style="width: 75%; margin-left: 12.5%;" src="../../images/lc3/fig3.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 3)</p>
      <br>
      
      <hr>
      <p><b>NOTE 2:</b> In my case I left the <b>last 3 fields</b> mentioned above in <code>None</code>, <code>None</code> and <code>Unchecked</code>.</p>
      <hr>
      <br>
      
      <p>Set the <b>Available Power Stars</b> for the scenario (just one in my case). Usually you would use the <b>Scenario index number</b> as the <b>star number</b> (<b>Fig. 4</b>). And the <b>layers</b> each <b>zone</b> will display for that <b>scenario</b> (<b>Fig. 5</b>).</p>
      
      <img style="width: 75%; margin-left: 12.5%;" src="../../images/lc3/fig4.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 4)</p>
      <br>
      <img style="width: 75%; margin-left: 12.5%;" src="../../images/lc3/fig5.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 5)</p>
      <br>
      
      <hr>
      <p><b>NOTE 3:</b> In my case I did not use any <b>layers</b> of the <b>available zones</b>, that means I am using the <code>Common</code> <b>layer</b>.</p>
      <hr>
      <br>
      
      <p><b>Save</b> and now you can open the <b>edited Galaxy</b> on <b>Whitehole</b> to check if the <b>new scenario</b> was added (<b>Fig. 6</b>).</p>
      
      <img src="../../images/lc3/fig6.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 6 - New Scenario created for FlipSwitch Galaxy)</p>
      <br>
      
      <p>Add a <b>Power Star object</b> into the <b>Galaxy</b> that has a <b>Power Star ID number</b> equal to the <b>star number</b> you checked on the <b>Available Power Stars section</b> of the <b>scenario editor</b> (<b>Fig. 7</b>).</p>
      
      <img src="../../images/lc3/fig7.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 7 - Power Star ID change to Scenario number)</p>
      <br>
      
      <p>You can now <b>save</b> and close <b>Whitehole</b>. The next thing to do is <b>2)</b>.</p>
      
      <p>Use <b>WiiExplorer</b> to extract the <code>message.bmg</code> and <code>messageid.tbl</code> files out if the <code>Message.arc</code> file of your <b>SMG1 language folder</b> and use <b>Tomato</b> to convert the <b>BMG and TBL files</b> into a <b>XML</b> (check <a href="basic/tb6.html">Edit text in SMG1</a>, <b>Figs. 8 and 9</b>).</p>
      
      <img src="../../images/lc3/fig8.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 8 - <code>Message.arc</code> file opened with WiiExplorer)</p>
      <br>
      
      <img src="../../images/lc3/fig9.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 9 - XML file created by Tomato)</p>
      <br>
      
      <p>Now, locate the <b>scenario name section</b> of your <b>Galaxy</b> on the <b>XML</b>. Search for a <b>known scenario name</b> of the <b>Galaxy</b> (<b>Fig. 10</b>).</p>
      
      <img src="../../images/lc3/fig10.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 10 - Scenario name search for the target Galaxy)</p>
      <br>
      
      <p>As it is a <i><b>new scenario</b></i> for this <b>Galaxy</b> we must create a <b>message tag</b> for our <b>scenario</b> below the last one for said <b>Galaxy</b> (<b>Fig. 11</b>). You can do that by changing the <code>ScenarioName_[Galaxy Name][Number]</code> to the <b>target Galaxy code name</b> (<code>[Galaxy Name]</code>) and the <b>target scenario number</b> (<code>[Number]</code>).</p>
      
      <img src="../../images/lc3/fig11.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 11 - Adding a name for the new scenario)</p>
      <br>
      
      <hr>
      <p><b>NOTE 4:</b> in my case the <b>target galaxy</b> is <code>FlipPanelExGalaxy</code> and the <b>target scenario number</b> is <code>2</code>.</p>
      <hr>
      <br>
      
      <p>After that you can <b>save</b> the <b>XML file</b>, pack it back to a <b>BMG and TBL</b> with <b>Tomato</b>, replace the pertinent <code>message.bmg</code> and <code>messageid.tbl</code> of the <code>Message.arc</code> <b>file</b> with them (check <a href="basic/tb6.html">Edit text in SMG1</a>) and you will be ready to <b>test your new scenario on game</b> >:]</p>
      
      <br>
      <hr>
      <p><b>NOTE 5:</b> the <b>maximun number of stars</b> in a <b>Galaxy</b> on <b>SMG1</b> are <b>7 stars</b> by default. <b>3 normal stars</b>, <b>1 hidden star</b> and <b>2 prankster comet</b> ones and <b>1 Luigi event</b> one. If you put all <b>7 stars</b> to be <b>normal ones</b> the game will show them <b>weirdly placed</b> on the <b>star select menu</b>. With <b>custom code</b> that can be fixed. Will <b>post it below</b> when I can get it.</p>
      <p><b>NOTE 6:</b> I hope that the <i>Epik Fourhawk Jumpscare</i> did not scare you too much :]</p>
      <hr>
      
      <br>
        
    </div>

	</body>

</html>
